<template>
  <div class="dashboard-container">
    <!-- <div class="dashboard-text">name: {{ name }}===={{ visibleFlag }}</div>
    <button @click="changeVisibleFlag"> 开关 </button>
    <dia :visible.sync="visibleFlag" />
    <br>
    <el-button @click="addRouter"> 添加路由 </el-button>
    <br>
    <el-button @click="$router.removeRouter('/test')"> 移除 </el-button>
    <br>
    <el-button @click="$router.push('/test')"> 跳转 </el-button> -->
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

import dia from './dia.vue'

export default {
  name: 'Dashboard',
  components: {
    dia
  },
  data() {
    return {
      visibleFlag: false
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  methods: {
    changeVisibleFlag() {
      this.visibleFlag = !this.visibleFlag
    },
    addRouter() {
      this.$router.addRoutes(
        [{
          path: '/test',
          component: () => import('./test.vue')
        }]
      )
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
